/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.strategy.vo;


import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.pig4cloud.pigx.common.customize.utils.serializer.BigDecimalToPlainStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 策略-合约App端详情VO
 *
 * @since 2022-11-24 10:39:27
 */
@Data
public class StrategyContractAppDetailVO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 平台id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long platformId;

    /**
     * 币对名称
     */
    private String symbolName;

    /**
     * 产品id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long productId;

    /**
     * 持仓方向（0做多、1做空、2双向）
     */
    private String side;

    /**
     * 杠杆倍数
     */
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    private BigDecimal multiple;

    /**
     * 策略组名称
     */
    private String groupName;

    /**
     * 开关id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long switchId;

    /**
     * 开关状态（0暂停、1运行中、2已结束、3关闭、4异常）
     */
    private String switchStatus;

    /**
     * 开关创建时间
     */
    private LocalDateTime switchCreateTime;

    /**
     * 当前价格
     */
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    private BigDecimal price;

    /**
     * 预估补仓价格
     */
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    private BigDecimal nextAddPrice;

    /**
     * 下次补仓比例
     */
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    private BigDecimal nextAddRatio;

    /**
     * 预估强平价
     */
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    private BigDecimal liquidatePrice = BigDecimal.ZERO;

    /**
     * 总盈利
     */
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    private BigDecimal profitTotal = BigDecimal.ZERO;

    /**
     * 收益率
     */
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    private BigDecimal profitRate = BigDecimal.ZERO;

    /**
     * 盈利
     */
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    private BigDecimal profit = BigDecimal.ZERO;

    /**
     * 保证金（初始保证金）
     */
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    private BigDecimal margin = BigDecimal.ZERO;

    /**
     * 币对图标地址
     */
    private String image;

    /**
     * 预扣燃油币
     */
    @JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
    private BigDecimal fuelFrozen;
}
